<template>
    <div class="app-container">
        <el-form ref="queryForm" label-width="68px" :inline="true" :model="queryParams">
            <el-form-item label="学号">
                <el-input v-model="queryParams.stuNo" size="mini" />
            </el-form-item>
            <el-form-item>
                <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
                <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
            </el-form-item>
        </el-form>

        <el-table :data="tableData" v-loading="loading">
            <el-table-column label="学号" align="center" prop="stuNo" />
            <el-table-column label="课程名称" align="center" prop="courseName" />

            <el-table-column label="成绩" align="center" prop="cj" />
        </el-table>
        <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
            @pagination="getList" />

    </div>
</template>
<script>

import {listCourseScore} from "@/api/stuCQS/basedata/course";

export default {
    name: 'basedatacoursescore',
    data() {
        return {
            queryParams: {
                stuNo: '',
                pageNum: 1,
                pageSize: 10
            },
            total:0,
            tableData:[],
            loading:false,
        }
    },
    methods: {
        resetQuery() {
            this.resetForm('queryForm')
            this.handleQuery()
        },
        handleQuery() {
            this.queryParams.pageNum = 1
            this.getList();
        },
        async getList() {
            this.loading = true;
            let res = await listCourseScore(this.queryParams);
            this.loading = false;
            if(res.code == 200){
                console.log(res)
                this.tableData = res.rows;
                this.total = res.total;
            }
        }
    }
}
</script>
